<link rel="stylesheet" type="text/css" href="../addons/jy_weishop/custom/templates/mobile/css/coupon.css?v=2.0.0">
<div ng-if="pagedata.op=='main'" class='fui-page  fui-page-current coupon-my-page'>
    <div class="fui-header">
		<div class="fui-header-left">
			<a class="back" ng-click="goback()"></a>
		</div>
		<div class="title">我的参与凭证</div> 
		<div class="fui-header-right">&nbsp;</div>
    </div>
	<div class='fui-content'>
		<div class='fui-tab fui-tab-danger' id='cateTab'>
			<a href="javascript:;" ng-click="tool.get_list('jy_wuliu/feelog/jielilist/status=10',true);pagedata.status=10" ng-class="{'active':pagedata.status==10}" data-cate=''>已参与</a>
			<a href="javascript:;" ng-click="tool.get_list('jy_wuliu/feelog/list/status=1',true);pagedata.status=1" ng-class="{'active':pagedata.status==1}" data-cate='used'>已支付</a>
			<a href="javascript:;" ng-click="tool.get_list('jy_wuliu/feelog/list/status=0',true);pagedata.status=0" ng-class="{'active':pagedata.status==0}" data-cate='used'>待支付</a>
			<a href="javascript:;" ng-click="tool.get_list('jy_wuliu/feelog/jielilist/status=2',true);pagedata.status=2" ng-class="{'active':pagedata.status==2}" data-cate='past'>已完成</a>
		</div>
		<div ng-if="pagedata.list.length<1" class="fui-message fui-message-popup in content-empty" style=" margin-top: 0; padding-top: 0; position: relative; height: auto; background: none;">
				<div class="icon">
					<i class="icon icon-information"></i>
				</div>
				<div class="content">您还没有参与凭证~</div>
		</div>
		<div id="container" class="coupon-container coupon-list">
			<div ng-repeat="item in pagedata.list" style="margin:0.3rem">
				<a class="coupon-item blue">
					<div class="coupon-dots">
							<i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i>
						</div>
						<div class="coupon-type" >{{item.typetitle || '参与'}}</div>
					<div class="coupon-left" href="javascript:;" ng-click="access_json('/item//id='+item.pid)">
						<div class="title blod" style="font-size:0.85rem">参与凭证</div>
						<div class="subtitle" style="font-size:0.56rem">参与序号：{{item.jieli_id || 1}}</div>
					</div>
					<div class="coupon-right">
						<div class="title" style="font-size:0.66rem">{{item.info.title[0]}}&#8644{{item.info.title[1] || '找车'}}</div>
						<div ng-if="item.status>=1 || item.orderid==0" class="subtitle" style="font-size:0.56rem;color:#999">{{item.typetitle || '参与'}} +1 </div>
						<div ng-if="item.status<=1 && item.orderid!=0" class="subtitle" style="font-size:0.56rem;color:#999">{{item.status==1?'已支付':'待支付'}} <span class="red">￥{{item.fee || '0.00'}}</span><span style="margin-left:0.3rem">时间:{{item.createtime}}</span></div>
						<div ng-if="item.status==2" class="subtitle" style="font-size:0.56rem;color:#999">已完成</div>
						<div class="usetime">
							<div class="text" ng-if="item.orderid==0">
								<div>时间:
									{{item.createtime}}
								</div>
							</div>
							<div ng-if="(item.status ==0 || item.status ==1) && item.orderid!=0" class="usebtn">
								<div ng-if="item.status==0" ng-click="pagedata.buypay(item.id)">
									支付
								</div>
								<div ng-if="item.status==1" ng-click="post({},'receive','id='+item.id)">
									确认
								</div>									
							</div>
							<div class="usebtn" style="margin-left:0.1rem">
								<div ng-if="item.orderid!=0" ng-click="access_json('/feelog/detail/isfee=true&id='+item.orderid)">
									查看详情
								</div>
								<div ng-if="item.orderid==0" ng-click="access_json('/feelog/detail/id='+item.id)">
									查看详情
								</div>								
							</div>
						</div>
					</div>
			</a>
		</div>
		</div>
	</div>
</div>
<div class="order-list-page" ng-if="pagedata.op == 'detail'">
    <div class="fui-header">
		<div class="fui-header-left" ng-click="goback()">
            <a class="back"></a>
        </div>
		<div class="title">参与详情</div>
		<div class="fui-header-right"></div>
	</div>
	<div class='fui-content member-page navbar' style="top:0">
		<div class="fui-list-group merchgroup">
			<div class="fui-list jump">
                <a class="fui-list-media">
                    <img class="round" src="{{tomedia(pagedata.member.avatar) || '../core/resource/images/nopic.jpg'}}" />
                </a>
                <div class="fui-list-inner">
					<div class="title" style="font-size:0.65rem">手机号：{{pagedata.member.mobile}}</div>
					<div class="title" style="font-size:0.65rem">昵称：{{pagedata.member.nickname}}</div>
                </div>
                <a class="jump" href="javascript:;">
					
				</a>
            </div>
		</div>
		<div class="weui_cells">
			<div class="weui_cell">
					<div class="weui_cell_bd weui_cell_primary">
						<span>参与标题</span>
					</div>
					<div class="weui_cell_ft" >{{pagedata.item.title}}</div>
			</div>
			<div class="weui_cell">
					<div class="weui_cell_bd weui_cell_primary">
						<span>参与类型</span>
					</div>
					<div class="weui_cell_ft" >{{pagedata.order.typetitle}}</div>
			</div>
			<div class="weui_cell">
					<div class="weui_cell_bd weui_cell_primary">
						<span>备注</span>
					</div>
					<div class="weui_cell_ft">{{pagedata.order.remark || '无'}}</div>
			</div>
			<div ng-if="pagedata.order.orderid>0" class="weui_cell">
					<div class="weui_cell_bd weui_cell_primary">
						<span>参与费用</span>
					</div>
					<div class="weui_cell_ft" ng-model="pagedata.order.fee">{{pagedata.order.fee}}元</div>
			</div>
			<div ng-if="pagedata.order.orderid>0" class="weui_cell">
					<div class="weui_cell_bd weui_cell_primary">
						<span>实际支付</span>
					</div>
					<div class="weui_cell_ft" ng-model="pagedata.order.fee">{{pagedata.order.fee}}元</div>
			</div>
		</div>
		<div class="weui_cells_title"><strong style="font-size: 0.8rem;">参与内容</strong> / <small>Con&nbsp;Jielong</small></div>
		<div class="weui_cells">
				<div class="weui_cell" ng-repeat="f in pagedata.order.data">
						<div class="weui_cell_bd weui_cell_primary">
							<span>{{f.title}}</span>
						</div>
						<div ng-if="f.type ==1 || f.type ==2 || f.type ==8 || f.type ==9" class="weui_cell_ft" ng-model="f.data">{{f.data}}</div>
						<div ng-if="f.type ==3 || f.type ==10" class="weui_cell_ft" ng-model="f.data">
						<ul class="weui_uploader_files" ng-if="f.data">
							  <li class="weui_uploader_file" style="background-image:url({{tomedia(f.data)}})"></li>
						</ul>
						</div>
						<div ng-if="f.type ==7" class="weui_cell_ft">{{f.data.province}} {{f.data.district}} {{f.data.city}} {{f.data.xiangxi}}</div>
						<div ng-if="f.type ==18" class="weui_cell_ft">￥<span class="price">{{f.data || '0.00'}}</span></div>
				</div>
				<div ng-if="!pagedata.order.data || pagedata.order.data.length<1" class="weui_cell">
					<div class="content-empty" style="margin-top:0.5rem">
						  <p style="color: #999;font-size: .75rem">无参与内容...</p>
					</div>
				</div>
		</div>
		<div class="weui_cells_title"><strong style="font-size: 0.8rem;">其他选填内容</strong> / <small>Con&nbsp;Jielong</small></div>
		<div class="weui_cells">
				<div class="weui_cell" ng-repeat="f in pagedata.order.diydata">
						<div class="weui_cell_bd weui_cell_primary">
							<span>{{f.title}}</span>
						</div>
						<div ng-if="f.type ==1 || f.type ==2 || f.type ==8 || f.type ==9" class="weui_cell_ft" ng-model="f.data">{{f.data}}</div>
						<div ng-if="f.type ==3 || f.type ==10" class="weui_cell_ft" ng-model="f.data">
						<ul class="weui_uploader_files" ng-if="f.data">
							  <li class="weui_uploader_file" style="background-image:url({{tomedia(f.data)}})"></li>
						</ul>
						</div>
						<div ng-if="f.type ==7" class="weui_cell_ft">{{f.data.province}} {{f.data.district}} {{f.data.city}} {{f.data.xiangxi}}</div>
						<div ng-if="f.type ==18" class="weui_cell_ft">￥<span class="price">{{f.data || '0.00'}}</span></div>
				</div>
				<div ng-if="!pagedata.order.diydata || pagedata.order.diydata.length<1" class="weui_cell">
					<div class="content-empty" style="margin-top:0.5rem">
						  <p style="color: #999;font-size: .75rem">无参与内容...</p>
					</div>
				</div>
		</div>
	</div>
</div><script>
scope.pagedata.buypay=function(id){
	scope.post_json('/feelog/pay/id='+id,{},function(pay_id){
		require(['tool'],function(tool){
			tool.pay(pay_id,function(res){
				console.log('收到支付结果！');
				if(res.type=='success'){
					scope.message('支付成功！','','feelog/');
				}else{
					scope.message('充值失败！');
				}
			});
		});
	});
}
if(scope.pagedata.status==1 || scope.pagedata.status==0){
	scope.tool.get_list('jy_wuliu/feelog/list/',true);
	scope.pagedata.scroll_bottom=function(){
		scope.tool.get_list('jy_wuliu/feelog/list/status='+scope.pagedata.status);
	}
}
if(scope.pagedata.status==10 || scope.pagedata.status==2){
	scope.tool.get_list('jy_wuliu/feelog/jielilist/',true);
	scope.pagedata.scroll_bottom=function(){
		scope.tool.get_list('jy_wuliu/feelog/jielilist/status='+scope.pagedata.status);
	}
}
</script>
<div ng-include="sys_html('_footer')"></div>